using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GameEngine.Navigation
{
	/// <summary>
	/// Helper for the NavigationMap constructor.
	/// </summary>
	internal struct FaceGroup
	{
		public int[] groups;
		public FaceGroup(int[] groups)
		{
			this.groups = groups;
		}
		public override bool Equals(object obj)
		{
			if (obj is FaceGroup)
			{
				FaceGroup other = (FaceGroup)obj;
				if (this.groups.Length != other.groups.Length)
				{
					return false;
				}
				for (int i = 0; i < this.groups.Length; i++)
				{
					if (this.groups[i] != other.groups[i])
					{
						return false;
					}
				}
				return true;
			}
			return false;
		}
		public override int GetHashCode()
		{
			int hash = this.groups.Length;
			for (int i = 0; i < this.groups.Length; i++)
			{
				hash = hash * 13 + this.groups[i];
			}
			return hash;
		}
		public override string ToString()
		{
			string s = this.GetType().Name;
			for (int i = 0; i < this.groups.Length; i++)
			{
				s += " " + this.groups[i];
			}
			return s;
		}
	}
}
